package com.fac.dto;

import com.fac.constant.EquipmentStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@ApiModel(description = "设备数据传输对象")
public class EquipmentDTO implements Serializable {

    @ApiModelProperty(value = "设备ID", example = "1")
    private Long equipmentId;

    @NotBlank(message = "设备编码不能为空")
    @ApiModelProperty(value = "设备编码", example = "EQ2024001", required = true)
    private String code;

    @NotBlank(message = "设备名称不能为空")
    @ApiModelProperty(value = "设备名称", example = "数控车床", required = true)
    private String name;

    @NotNull(message = "分类ID不能为空")
    @ApiModelProperty(value = "分类ID", example = "1", required = true)
    private Long categoryId;

    @ApiModelProperty(value = "品牌", example = "DMG森精机")
    private String brand;

    @ApiModelProperty(value = "型号", example = "NLX 2500")
    private String model;

    @NotNull(message = "设备状态不能为空")
    @ApiModelProperty(value = "设备状态", example = "IDLE", allowableValues = "IDLE,IN_USE,UNDER_REPAIR,SCRAPPED", required = true)
    private EquipmentStatus status;

    @ApiModelProperty(value = "购买日期", example = "2024-01-01 12:00:00")
    private LocalDateTime purchaseDate;

    @ApiModelProperty(value = "价值", example = "150000.00")
    private BigDecimal value;

    @ApiModelProperty(value = "规格", example = "1500x800x1200mm")
    private String specifications;

    @ApiModelProperty(value = "位置", example = "A区-01-001")
    private String location;

    @ApiModelProperty(value = "供应商", example = "上海机床厂")
    private String supplier;

    @ApiModelProperty(value = "保修期", example = "2025-01-01 12:00:00")
    private LocalDateTime warrantyPeriod;

    @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "更新时间", example = "2024-01-01 12:00:00")
    private LocalDateTime updatedAt;
}
